package edu.scut.course_management.dao;

import edu.scut.course_management.po.Resource;
import edu.scut.course_management.po.Section;
import org.apache.ibatis.annotations.Param;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 数据访问，对应库表section_resource
 * @author shawshank
 */
@Repository
public interface SectionResourceMapper {

	// 将课程资源添加到课程
	void addResourceToSections(Map<String, Object> params) throws DataAccessException;
	// 找出课程资源所属的课程
	List<Section> findSectionsThroughResource(@Param("resourceNodeId") Integer resourceNodeId);
	// 找出某节课顶级目录下的所有资源结点
	List<Resource> findTopLevelResourceOfSection(Section section);
}
